package main

import (
	"fmt"
	"ginweb/module/db"
	"ginweb/module/web"
)

func main() {

	mysqlConnection := fmt.Sprintf("%s:%s@(%s:%s)/%s?charset=utf8", "root", "123456", "127.0.0.1", "3306", "ginweb")
	err := db.Init(mysqlConnection)
	if err != nil {
		println("database err:" + err.Error())
		return
	}

	err = web.Init().Run(web.Host)
	if err != nil {
		println("ginweb run err:" + err.Error())
	}
}
